package moa.learners;

import moa.MOAObject;
import moa.core.Measurement;
import moa.core.StringUtils;
import moa.options.IntOption;
import weka.core.Instance;
import weka.core.Instances;

public class ShowData extends AbstractLearner{

	protected Instances data;
	
	public IntOption nbInstanceOption = new IntOption("NumberOfInstances", 'n',
			"Number of instance to show (Max 20).", 5, 1,
			1000);
	
	@Override
	public void getModelDescription(StringBuilder out, int indent) {
		// TODO Auto-generated method stub
		out.append("The Data\n");
		out.append(data);
		StringUtils.appendNewline(out);
	}

	@Override
	protected Measurement[] getModelMeasurementsImpl() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void resetLearningImpl() {
		// TODO Auto-generated method stub
		
	}
	protected int numberInstances;
	
	
	@Override
	public void trainOnInstanceImpl(Instance inst) {
	    if (numberInstances == 0) {
            data = new Instances(inst.dataset());
	    }
	    this.numberInstances++;
	    if (numberInstances < nbInstanceOption.getValue()+1)
	    	data.add(inst);	
	}


	@Override
	public MOAObject getModel() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isRandomizable() {
		// TODO Auto-generated method stub
		return false;
	} 

}
